package com.flexandair.controller
{
	import com.flexandair.view.CRUDdyBuddyMediator;
	import com.flexandair.view.ServerPropertiesMediator;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	public class ViewPrepCommand extends SimpleCommand implements ICommand
	{
		public function ViewPrepCommand()
		{
			super();
		}
		
		override public function execute(notification:INotification):void
		{
			var application:CRUDdyBuddy = notification.getBody() as CRUDdyBuddy;
			facade.registerMediator( new CRUDdyBuddyMediator(CRUDdyBuddyMediator.NAME, application ) );
			facade.registerMediator( new ServerPropertiesMediator(ServerPropertiesMediator.NAME, application.serverProperties ) );
		}	
	}
}